<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <title>出款挂起</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon"/>
    <!-- 当前页面样式 -->
    <link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
    <!-- 当前页面样式 END -->
    <script type="text/javascript" src="<c:url value="/js/jquery-1.3.2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
	<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
	<script type="text/javascript">
	$(document).ready(function(){
		$('#all').click(function(){
			var status=$('#all').attr("checked");
			$("input[name=multiSel]").attr("checked",status);
		});
	});
	//查询结算信息
		function queryCheck(){
				$("#queryUserForm").attr("action","<%=basePath%>/hang/queryHangMoneyJsp.ct")
				$("#queryUserForm").submit();
				$("#queryBtnId").attr("disabled","true");
				$("#szPower").attr("disabled","true");
				$("#export").attr("disabled","true");
				$("#free").attr("disabled","true");
		}
		function exportInput(){
			$("#queryUserForm").attr("action","<%=basePath%>/hang/startExportJsp.ct")
			$("#queryUserForm").submit();
			$("#export").attr("disabled","true");
			$("#free").attr("disabled","true");
			$("#szPower").attr("disabled","true");
		}
		function freeListSimple(){//出款释放
			var dd = $("input[name=multiSel]:checked");
			if(dd.length == 0){
				alert("请选择记录");
				return false;
			}
				$("#queryUserForm").attr("action","<%=basePath%>/hang/freePayInit.ct")
				$("#queryUserForm").submit();
				$("#free").attr("disabled","true");
				$("#export").attr("disabled","true");
				$("#szPower").attr("disabled","true");
		}
		function hangListSimple(){//出款挂起
			var dd = $("input[name=multiSel]:checked");
			if(dd.length == 0){
				alert("请选择记录");
				return false;
			}
				$("#queryUserForm").attr("action","<%=basePath%>/hang/hangPaySettlement.ct")
				$("#queryUserForm").submit();
				$("#queryBtnId").attr("disabled","true");
				$("#res").attr("disabled","true");
				$("#szPower").attr("disabled","true");
				$("#apply").attr("disabled","true");
				$("#applylist").attr("disabled","true");
				$("#hang").attr("disabled","true");
		}	
	</script>
</head>
<body>
<s:form id="queryUserForm" action="/hang/queryHangMoneyJsp.ct" method="post" theme="simple">
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">出款挂起</div></td>
        </tr>
		<tr class="tb-line">
            
            <td align="right" class="tb-td">
                <div class="tb-h4">商户号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield name="searchCondition.mchtCd" cssClass="queryWidth"></s:textfield>
                </label>
            </td>
            
            <td align="right" class="tb-td">
                <div class="tb-h4">商户名：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal">
                <s:textfield name="searchCondition.mchtName" cssClass="queryWidth"></s:textfield>
                </label>
            </td>
        </tr>		
        <tr class="tb-line">
            <td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">银行账号：</div>
            </td>
            <td class="tb-td">
 				<label class="tb-input-normal">
 				 <s:textfield name="searchCondition.accountNo" cssClass="queryWidth"></s:textfield>
 				</label></td>
			<td align="right" class="tb-td">
                <div class="tb-h4">结算日期：</div>
            </td>
             <td class="tb-td">
                <label class="tb-input-mini">
                <s:textfield id="settleDateMin" name="searchCondition.applyDateMin" placeholder="起始日期" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" cssClass="queryWidth"></s:textfield>
                </label>-
                <label class="tb-input-mini">
                <s:textfield id="settleDateMax" name="searchCondition.applyDateMax" placeholder="结束日期" onFocus="WdatePicker({dateFmt:'yyyyMMdd',readOnly:true,wdate:true,errDealMode:0});" cssClass="queryWidth"></s:textfield>
                </label>
            </td>
            
        </tr>
         <tr class="tb-line">
 
			<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">机构：</div>
            </td>
            <td class="tb-td">
 				<label class="tb-select">
				 <s:select name="searchCondition.org" list="#{'48502000':'新POSP'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="orgCode"/> 
                </label>
             </td>
              <td align="right" class="tb-td">
                <div class="tb-h4">账户性质：</div>
            </td>
            <td class="tb-td">
 				<label class="tb-select">
				 <s:select name="searchCondition.nature" list="#{'01':'对公','02':'对私'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="orgCode"/> 
                </label>
             </td>           
        </tr>
        <tr class="tb-line">
 
			<td width="12%" style="min-width: 150px" align="right" class="tb-td">
                <div class="tb-h4">出款类型：</div>
            </td>
            <td class="tb-td">
 				<label class="tb-select">
				 <s:select name="searchCondition.type" list="#{'0':'普通交易出款','1':'扫码出款'}" headerKey="" headerValue="不限" cssClass="queryWidth" id="orgCode"/> 
                </label>
             </td>          
        </tr>       
		<tr>
						<td colspan="4" align="center"><span style="color: red"><s:actionerror /></span>
							<span style="color: red;"><s:actionmessage /></span > <span style="color: red;"><s:fielderror
									cssClass="fieldError" /></span>
							<span id="otherError"></span>
						</td>
		</tr>
        
        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <input id="queryBtnId" type="button" value="查询" onclick="queryCheck()"/>
                </label>
                <label class="tb-input-submit">
                    <input type="reset" value="取消"/>
                </label>
                <s:if test="#session.session_merchant.roleType==\"06\" || #session.session_merchant.roleType==\"07\"">
                 <label class="tb-input-submit">
               	<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
					   		<input id="hang" type="button" value="出款挂起" onclick="hangListSimple()"/>				   
					</s:if>
					<s:else>
					 	<input id="hang" disabled="disabled" value="出款挂起" type="button" /> 
					</s:else>				
               </label>       
                 <label class="tb-input-submit">
					   	<input id="export" type="button" value="出款挂起批量导入" onclick="exportInput()"/>				   									
               </label>                
               </s:if>
            </td>
        </tr>
        <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
			<tr class="tb-line">
				<td class="tb-td paging"  align="left" colspan="4"> <page:pageCount
								max_pages="11" totalPage="${requestScope.totalPage}"
								currentPage="${requestScope.currentPage}"
								action="${rootPath}/hang/queryHangMoneyJsp.ct?currentPage=" />

				</td>
			</tr>
		</s:if>
    </tbody>
</table>

<div class="big-tb">
    <table class="tb" style="width: 100%;">
        <thead>
            <tr class="tb-line">
                <th class="tb-th" colspan="16">结算完成信息列表</th>
            </tr>
            <tr class="tb-line bg-gray">
            	<s:if test="#session.session_merchant.roleType==\"06\" || #session.session_merchant.roleType==\"07\"">
            	<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
                   			<th class="tb-th">
                   			<input id="all" type="checkbox"/>
                   			</th>
                </s:if>
                </s:if>
                <th class="tb-th">商户号</th>
                <th class="tb-th">商户名称</th>                
                <th class="tb-th">账号名称</th>
                <th class="tb-th">结算银行</th>
                <th class="tb-th">结算银行账号</th>
                <th class="tb-th">结算日期</th>
                <th class="tb-th">出款状态</th>
                <th class="tb-th">出款金额（元）</th>
                <th class="tb-th">商户手续费（元）</th>
                <th class="tb-th">冻结金额（元）</th>
                <th class="tb-th">结算金额（元）</th>               
                <th class="tb-th">交易金额（元）</th>
                <th class="tb-th">出款类型</th>               
            </tr>
        </thead>
        <tbody>
			<s:iterator value="#request.settleList" status="stat" id="bean">
				<tr  class="tb-line"  >
					<s:if test="#session.session_merchant.roleType==\"06\" || #session.session_merchant.roleType==\"07\"">
					<s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
							<td class="tb-td" align="center">
                   			<input name="multiSel" value="<s:property value="#bean.remark1"/>" type="checkbox" />
                   			</td>
                	</s:if>
                	</s:if>
					<td class="tb-td">
						<s:property value="#bean.mchtCd"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.mchtName"/>
					</td>
					
					<td class="tb-td">
						<s:property value="#bean.accountName"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.bankName"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.account"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.settleDate"/>
					</td>
					<td class="tb-td">
						<s:if test="#bean.settleFlag == 1">
						结算完成
						</s:if>
						<s:else>
						待定
						</s:else>
					</td>
					<td class="tb-td">
						<s:property value="#bean.unFreezeAmt"/>
					</td>				
					<td class="tb-td">
						<s:property value="#bean.mchtFee"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.freezeAmt"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.mchtSetAmt"/>
					</td>
					<td class="tb-td">
						<s:property value="#bean.transAmt"/>
					</td>
					<td class="tb-td">
						<s:if test="#bean.remark==\"0\" ">
							普通交易出款
						</s:if>
						<s:elseif test="#bean.remark==\"1\"">
							扫码出款
						</s:elseif>
						<s:else>
							未知
						</s:else>
					</td>
				</tr>
			</s:iterator>
        </tbody>
    </table>
</div>
</s:form>
</body>
</html>